<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=0.8"/><title>7.8&nbsp;建立新合约</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="racket.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9658;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Racket&#25351;&#21335;</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="intro.html" class="tocviewlink" data-pltdoc="x">&#27426;&#36814;&#26469;&#21040;Racket!</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="to-scheme.html" class="tocviewlink" data-pltdoc="x">Racket&#27010;&#35201;</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="datatypes.html" class="tocviewlink" data-pltdoc="x">&#20869;&#32622;&#30340;&#25968;&#25454;&#31867;&#22411;</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="scheme-forms.html" class="tocviewlink" data-pltdoc="x">&#34920;&#36798;&#24335;&#21644;&#23450;&#20041;</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="define-struct.html" class="tocviewlink" data-pltdoc="x">&#31243;&#24207;&#21592;&#23450;&#20041;&#30340;&#25968;&#25454;&#31867;&#22411;</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="modules.html" class="tocviewlink" data-pltdoc="x">&#27169;&#22359;</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="contracts.html" class="tocviewselflink" data-pltdoc="x">&#21512;&#32422;</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="i_o.html" class="tocviewlink" data-pltdoc="x">&#36755;&#20837;&#21644;&#36755;&#20986;</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="regexp.html" class="tocviewlink" data-pltdoc="x">&#27491;&#21017;&#34920;&#36798;&#24335;</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">&#24322;&#24120;&#19982;&#25511;&#21046;</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="for.html" class="tocviewlink" data-pltdoc="x">&#36845;&#20195;&#21644;&#25512;&#23548;</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">&#27169;&#24335;&#21305;&#37197;</a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="classes.html" class="tocviewlink" data-pltdoc="x">&#31867;&#21644;&#23545;&#35937;</a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="units.html" class="tocviewlink" data-pltdoc="x">&#21333;&#20803;</a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="reflection.html" class="tocviewlink" data-pltdoc="x">&#21453;&#23556;&#21644;&#21160;&#24577;&#27714;&#20540;</a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="macros.html" class="tocviewlink" data-pltdoc="x">&#23439;</a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="languages.html" class="tocviewlink" data-pltdoc="x">&#21019;&#36896;&#35821;&#35328;</a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">&#24182;&#21457;&#19982;&#21516;&#27493;</a></td></tr><tr><td align="right">19&nbsp;</td><td><a href="performance.html" class="tocviewlink" data-pltdoc="x">&#24615;&#33021;</a></td></tr><tr><td align="right">20&nbsp;</td><td><a href="parallelism.html" class="tocviewlink" data-pltdoc="x">&#24182;&#34892;</a></td></tr><tr><td align="right">21&nbsp;</td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">&#36816;&#34892;&#21644;&#21019;&#24314;&#21487;&#25191;&#34892;&#31243;&#24207;</a></td></tr><tr><td align="right">22&nbsp;</td><td><a href="More_Libraries.html" class="tocviewlink" data-pltdoc="x">&#26356;&#22810;&#30340;&#24211;</a></td></tr><tr><td align="right">23&nbsp;</td><td><a href="dialects.html" class="tocviewlink" data-pltdoc="x">Racket&#21644;Scheme&#30340;&#26041;&#35328;</a></td></tr><tr><td align="right">24&nbsp;</td><td><a href="other-editors.html" class="tocviewlink" data-pltdoc="x">&#21629;&#20196;&#34892;&#24037;&#20855;&#21644;&#20320;&#30340;&#32534;&#36753;&#22120;&#36873;&#25321;</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9660;</a></td><td>7&nbsp;</td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">&#21512;&#32422;</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">7.1&nbsp;</td><td><a href="contract-boundaries.html" class="tocviewlink" data-pltdoc="x">&#21512;&#32422;&#21644;&#36793;&#30028;</a></td></tr><tr><td align="right">7.2&nbsp;</td><td><a href="contract-func.html" class="tocviewlink" data-pltdoc="x">&#20989;&#25968;&#30340;&#31616;&#21333;&#21512;&#32422;</a></td></tr><tr><td align="right">7.3&nbsp;</td><td><a href="contracts-general-functions.html" class="tocviewlink" data-pltdoc="x">&#19968;&#33324;&#21151;&#33021;&#21512;&#32422;</a></td></tr><tr><td align="right">7.4&nbsp;</td><td><a href="contracts-first.html" class="tocviewlink" data-pltdoc="x">&#21512;&#32422;&#65306;&#19968;&#20010;&#23436;&#25972;&#30340;&#20363;&#23376;</a></td></tr><tr><td align="right">7.5&nbsp;</td><td><a href="contracts-struct.html" class="tocviewlink" data-pltdoc="x">&#32467;&#26500;&#19978;&#30340;&#21512;&#32422;</a></td></tr><tr><td align="right">7.6&nbsp;</td><td><a href="contracts-exists.html" class="tocviewlink" data-pltdoc="x">&#29992;<span class="RktPn">#:<span class="mywbr"> &nbsp;</span>exists</span>&#21644;<span class="RktPn">#:<span class="mywbr"> &nbsp;</span>&#8707;</span>&#25277;&#35937;&#21512;&#32422;</a></td></tr><tr><td align="right">7.7&nbsp;</td><td><a href="contracts-examples.html" class="tocviewlink" data-pltdoc="x">&#38468;&#21152;&#23454;&#20363;</a></td></tr><tr><td align="right">7.8&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">&#24314;&#31435;&#26032;&#21512;&#32422;</a></td></tr><tr><td align="right">7.9&nbsp;</td><td><a href="contracts-gotchas.html" class="tocviewlink" data-pltdoc="x">&#38382;&#39064;</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_2&quot;);">&#9658;</a></td><td>7.8&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">&#24314;&#31435;&#26032;&#21512;&#32422;</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">7.8.1&nbsp;</td><td><a href="#%28part._.Contract-.Struct-.Properties%29" class="tocviewlink" data-pltdoc="x">&#21512;&#32422;&#32467;&#26500;&#23646;&#24615;</a></td></tr><tr><td align="right">7.8.2&nbsp;</td><td><a href="#%28part._.With-all-the-.Bells-and-.Whistles%29" class="tocviewlink" data-pltdoc="x">&#20351;&#25152;&#26377;&#35686;&#21578;&#21644;&#25253;&#35686;&#19968;&#33268;</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">7.8.1<tt>&nbsp;</tt></span><a href="#%28part._.Contract-.Struct-.Properties%29" class="tocsubseclink" data-pltdoc="x">&#21512;&#32422;&#32467;&#26500;&#23646;&#24615;</a></td></tr><tr><td><span class="tocsublinknumber">7.8.2<tt>&nbsp;</tt></span><a href="#%28part._.With-all-the-.Bells-and-.Whistles%29" class="tocsubseclink" data-pltdoc="x">&#20351;&#25152;&#26377;&#35686;&#21578;&#21644;&#25253;&#35686;&#19968;&#33268;</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="contracts-examples.html" title="backward to &quot;7.7 附加实例&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="contracts.html" title="up to &quot;7 合约&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="contracts-gotchas.html" title="forward to &quot;7.9 问题&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h4>7.8<tt>&nbsp;</tt><a name="(part._.Building-.New-.Contracts)"></a>&#24314;&#31435;&#26032;&#21512;&#32422;</h4><p>&#21512;&#32422;&#22312;&#20869;&#37096;&#20316;&#20026;&#20989;&#25968;&#26469;&#34920;&#31034;&#65292;&#36825;&#20010;&#20989;&#25968;&#25509;&#21463;&#20851;&#20110;&#21512;&#32422;&#30340;&#20449;&#24687;&#65288;&#24402;&#21646;&#20110;&#35841;&#12289;&#28304;&#31243;&#24207;&#20301;&#32622;&#31561;&#31561;&#65289;&#24182;&#20135;&#29983;&#25191;&#34892;&#21512;&#32422;&#30340;&#25512;&#26029;&#65288;&#26412;&#30528;Dana Scott&#30340;&#31934;&#31070;&#65289;&#12290;</p><p>&#19968;&#33324;&#24847;&#20041;&#19978;&#65292;&#19968;&#20010;&#25512;&#26029;&#26159;&#25509;&#21463;&#19968;&#20010;&#20219;&#24847;&#20540;&#30340;&#19968;&#20010;&#20989;&#25968;&#65292;&#24182;&#36820;&#22238;&#28385;&#36275;&#30456;&#24212;&#21512;&#32422;&#30340;&#19968;&#20010;&#20540;&#12290;&#20363;&#22914;&#65292;&#21482;&#25509;&#21463;&#25972;&#25968;&#30340;&#19968;&#20010;&#25512;&#26029;&#23545;&#24212;&#20110;&#21512;&#32422;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">flat-contract</span></span></span><span class="stt"> </span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="RktPn">)</span>&#65292;&#21516;&#26102;&#21487;&#20197;&#36825;&#26679;&#32534;&#20889;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">int-proj</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">x</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">signal-contract-violation</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#20316;&#20026;&#31532;&#20108;&#20010;&#20363;&#23376;&#65292;&#25509;&#21463;&#25972;&#25968;&#19978;&#30340;&#19968;&#20803;&#20989;&#25968;&#30340;&#19968;&#20010;&#25512;&#26029;&#30475;&#36215;&#26469;&#20687;&#36825;&#26679;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">int-&gt;int-proj</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-proj</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">signal-contract-violation</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#34429;&#28982;&#36825;&#20123;&#25512;&#26029;&#20855;&#26377;&#24688;&#24403;&#30340;&#38169;&#35823;&#34892;&#20026;&#65292;&#20294;&#23427;&#20204;&#36824;&#19981;&#22826;&#36866;&#21512;&#20316;&#20026;&#21512;&#32422;&#20351;&#29992;&#65292;&#22240;&#20026;&#23427;&#20204;&#19981;&#23481;&#32435;&#24402;&#21646;&#20063;&#19981;&#25552;&#20379;&#33391;&#22909;&#30340;&#38169;&#35823;&#28040;&#24687;&#12290;&#20026;&#20102;&#36866;&#24212;&#36825;&#20123;&#65292;&#21512;&#32422;&#19981;&#21482;&#20351;&#29992;&#31616;&#21333;&#30340;&#25512;&#26029;&#65292;&#32780;&#26159;&#20351;&#29992;&#25509;&#21463;&#19968;&#20010;<font class="badlink"><span class="techoutside"><span class="techinside">&#24402;&#21646;&#23545;&#35937;&#65288;blame object&#65289;</span></span></font>&#30340;&#20989;&#25968;&#23558;&#34987;&#24402;&#21646;&#21452;&#26041;&#30340;&#21517;&#23383;&#23553;&#35013;&#36215;&#26469;&#65292;&#20197;&#21450;&#21512;&#32422;&#24314;&#31435;&#30340;&#28304;&#20195;&#30721;&#20301;&#32622;&#21644;&#21512;&#32422;&#21517;&#31216;&#30340;&#35760;&#24405;&#12290;&#28982;&#21518;&#65292;&#23427;&#20204;&#21487;&#20197;&#20381;&#27425;&#20256;&#36882;&#36825;&#20123;&#20449;&#24687;&#32473;<span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span>&#26469;&#21457;&#20986;&#19968;&#20010;&#33391;&#22909;&#30340;&#38169;&#35823;&#20449;&#24687;&#12290;</p><p>&#36825;&#37324;&#26159;&#36825;&#20004;&#20010;&#25512;&#26029;&#20013;&#30340;&#31532;&#19968;&#20010;&#65292;&#34987;&#37325;&#20889;&#20197;&#22312;&#21512;&#32422;&#31995;&#32479;&#20013;&#20351;&#29992;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">x</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">x</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected:</span><span class="hspace">&nbsp;</span><span class="RktVal">"&lt;integer&gt;"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#26032;&#30340;&#35770;&#25454;&#25351;&#26126;&#20102;&#35841;&#23558;&#22240;&#20026;&#27491;&#25968;&#21644;&#36127;&#25968;&#30340;&#21512;&#32422;&#36829;&#32422;&#34987;&#24402;&#21646;&#12290;</p><p>&#22312;&#36825;&#20010;&#31995;&#32479;&#20013;&#65292;&#21512;&#32422;&#24635;&#26159;&#24314;&#31435;&#22312;&#21452;&#26041;&#20043;&#38388;&#12290;&#19968;&#26041;&#31216;&#20026;&#26381;&#21153;&#22120;&#65292;&#26681;&#25454;&#36825;&#20010;&#21512;&#32422;&#25552;&#20379;&#19968;&#20123;&#20540;&#65307;&#21478;&#19968;&#26041;&#31216;&#20026;&#23458;&#25143;&#31471;&#65292;&#20063;&#26681;&#25454;&#36825;&#20010;&#21512;&#32422;&#25509;&#21463;&#36825;&#20123;&#20540;&#12290;&#26381;&#21153;&#22120;&#31216;&#20026;&#20027;&#21160;&#20301;&#32622;&#65292;&#23458;&#25143;&#31471;&#31216;&#20026;&#34987;&#21160;&#20301;&#32622;&#12290;&#22240;&#27492;&#65292;&#23545;&#20110;&#20165;&#22312;&#25972;&#25968;&#21512;&#32422;&#30340;&#24773;&#20917;&#19979;&#65292;&#21807;&#19968;&#21487;&#33021;&#20986;&#38169;&#30340;&#26159;&#25152;&#25552;&#20379;&#30340;&#20540;&#19981;&#26159;&#19968;&#20010;&#25972;&#25968;&#12290;&#22240;&#27492;&#65292;&#27704;&#36828;&#21482;&#26377;&#20027;&#21160;&#30340;&#19968;&#26041;&#65288;&#26381;&#21153;&#22120;&#65289;&#25165;&#33021;&#33719;&#24471;&#24402;&#21646;&#12290;<span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span>&#20989;&#25968;&#24635;&#26159;&#24402;&#21646;&#20027;&#21160;&#30340;&#19968;&#26041;&#12290;</p><p>&#19982;&#25105;&#20204;&#30340;&#20989;&#25968;&#21512;&#32422;&#30340;&#25512;&#26029;&#30340;&#27604;&#36739;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-&gt;int-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-proj</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-swap</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rng</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"a procedure of one argument"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#22312;&#36825;&#31181;&#24773;&#20917;&#19979;&#65292;&#21807;&#19968;&#26126;&#30830;&#30340;&#24402;&#21646;&#28085;&#30422;&#20102;&#19968;&#20010;&#25552;&#20379;&#32473;&#21512;&#32422;&#30340;&#38750;&#36807;&#31243;&#25110;&#19968;&#20010;&#36825;&#20010;&#19981;&#25509;&#21463;&#19968;&#20010;&#21442;&#25968;&#30340;&#36807;&#31243;&#30340;&#24773;&#20917;&#12290;&#19982;&#25972;&#25968;&#25512;&#26029;&#19968;&#26679;&#65292;&#36825;&#37324;&#30340;&#24402;&#21646;&#20063;&#22312;&#20110;&#36825;&#20010;&#20540;&#30340;&#29983;&#25104;&#22120;&#65292;&#36825;&#23601;&#26159;&#20026;&#20160;&#20040;<span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span>&#20256;&#36882;&#27809;&#26377;&#25913;&#21464;&#30340;<span class="RktSym">blame</span>&#12290;</p><p>&#23545;&#20110;&#23450;&#20041;&#22495;&#21644;&#20540;&#22495;&#30340;&#26816;&#26597;&#34987;&#22996;&#25176;&#32473;&#20102;<span class="RktSym">int-proj</span>&#20989;&#25968;&#65292;&#23427;&#22312;<span class="RktSym">int-&gt;int-proj</span>&#20989;&#25968;&#30340;&#21069;&#38754;&#20004;&#34892;&#25552;&#20379;&#20854;&#21442;&#25968;&#12290;&#36825;&#37324;&#30340;&#35776;&#31373;&#26159;&#65292;&#21363;&#20351;<span class="RktSym">int-&gt;int-proj</span>&#20989;&#25968;&#24635;&#26159;&#24402;&#21646;&#20110;&#23427;&#25152;&#35748;&#20026;&#30340;&#20027;&#21160;&#26041;&#65292;&#25105;&#20204;&#21487;&#20197;&#36890;&#36807;&#22312;&#32473;&#23450;&#30340;<font class="badlink"><span class="techoutside"><span class="techinside">&#24402;&#21646;&#23545;&#35937;&#65288;blame object&#65289;</span></span></font>&#19978;&#35843;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">blame-swap</span></span></span>&#26469;&#20114;&#25442;&#24402;&#21646;&#26041;&#65292;&#29992;&#34987;&#21160;&#26041;&#26356;&#25442;&#20027;&#21160;&#26041;&#65292;&#21453;&#20043;&#20134;&#28982;&#12290;</p><p>&#28982;&#32780;&#65292;&#36825;&#31181;&#25216;&#26415;&#24182;&#19981;&#20165;&#20165;&#26159;&#19968;&#20010;&#35753;&#36825;&#20010;&#20363;&#23376;&#24037;&#20316;&#30340;&#24265;&#20215;&#25216;&#24039;&#12290;&#20027;&#21160;&#26041;&#21644;&#34987;&#21160;&#26041;&#30340;&#21453;&#36716;&#26159;&#19968;&#20010;&#20989;&#25968;&#34892;&#20026;&#26041;&#24335;&#30340;&#33258;&#28982;&#32467;&#26524;&#12290;&#20063;&#23601;&#26159;&#35828;&#65292;&#24819;&#35937;&#22312;&#20004;&#20010;&#27169;&#22359;&#20043;&#38388;&#30340;&#19968;&#20010;&#31243;&#24207;&#37324;&#30340;&#20540;&#27969;&#12290;&#39318;&#20808;&#65292;&#19968;&#20010;&#27169;&#22359;&#65288;&#26381;&#21153;&#22120;&#65289;&#23450;&#20041;&#20102;&#19968;&#20010;&#20989;&#25968;&#65292;&#28982;&#21518;&#37027;&#20010;&#27169;&#22359;&#34987;&#21478;&#19968;&#20010;&#27169;&#22359;&#65288;&#23458;&#25143;&#31471;&#65289;&#25152;&#20381;&#36182;&#12290;&#21040;&#30446;&#21069;&#20026;&#27490;&#65292;&#36825;&#20010;&#20989;&#25968;&#26412;&#36523;&#24517;&#39035;&#20174;&#21407;&#22987;&#20986;&#21457;&#65292;&#25552;&#20379;&#27169;&#22359;&#32473;&#36825;&#20010;&#38656;&#27714;&#27169;&#22359;&#12290;&#29616;&#22312;&#65292;&#20551;&#35774;&#38656;&#27714;&#27169;&#22359;&#35843;&#29992;&#36825;&#20010;&#20989;&#25968;&#65292;&#20026;&#23427;&#25552;&#20379;&#19968;&#20010;&#21442;&#25968;&#12290;&#27492;&#26102;&#65292;&#20540;&#27969;&#36870;&#36716;&#12290;&#36825;&#20010;&#21442;&#25968;&#27491;&#22312;&#20174;&#38656;&#27714;&#27169;&#22359;&#22238;&#27969;&#21040;&#25552;&#20379;&#30340;&#27169;&#22359;&#65281;&#36825;&#20010;&#23458;&#25143;&#31471;&#27491;&#22312;&#8220;&#25552;&#20379;&#8221;&#21442;&#25968;&#32473;&#26381;&#21153;&#22120;&#65292;&#24182;&#19988;&#36825;&#20010;&#26381;&#21153;&#22120;&#27491;&#22312;&#20316;&#20026;&#23458;&#25143;&#31471;&#25509;&#25910;&#37027;&#20010;&#20540;&#12290;&#26368;&#21518;&#65292;&#24403;&#36825;&#20010;&#20989;&#25968;&#20135;&#29983;&#19968;&#20010;&#32467;&#26524;&#26102;&#65292;&#37027;&#20010;&#32467;&#26524;&#22312;&#21407;&#22987;&#26041;&#21521;&#19978;&#20174;&#26381;&#21153;&#22120;&#22238;&#27969;&#21040;&#23458;&#25143;&#31471;&#12290;&#22240;&#27492;&#65292;&#23450;&#20041;&#22495;&#19978;&#30340;&#21512;&#32422;&#20498;&#36716;&#20102;&#20027;&#21160;&#30340;&#21644;&#34987;&#21160;&#30340;&#24402;&#21646;&#26041;&#65292;&#23601;&#20687;&#20540;&#27969;&#36870;&#36716;&#19968;&#26679;&#12290;</p><p>&#25105;&#20204;&#21487;&#20197;&#21033;&#29992;&#36825;&#20010;&#39046;&#24735;&#26469;&#27010;&#25324;&#20989;&#25968;&#21512;&#32422;&#24182;&#26500;&#24314;&#19968;&#20010;&#20989;&#25968;&#65292;&#23427;&#25509;&#21463;&#20219;&#24847;&#20004;&#20010;&#21512;&#32422;&#24182;&#20026;&#23427;&#20204;&#20043;&#38388;&#30340;&#20989;&#25968;&#36820;&#22238;&#19968;&#20010;&#21512;&#32422;&#12290;</p><p>&#36825;&#19968;&#25512;&#26029;&#20063;&#36208;&#30340;&#26356;&#36828;&#32780;&#19988;&#22312;&#19968;&#20010;&#21512;&#32422;&#36829;&#21453;&#34987;&#26816;&#27979;&#21040;&#26102;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span>&#26469;&#25913;&#36827;&#38169;&#35823;&#20449;&#24687;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-simple-function-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">dom-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">range-proj</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">blame</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom-proj</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"the argument of"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:swap?</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">range-proj</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"the range of"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rng</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"a procedure of one argument"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#34429;&#28982;&#36825;&#20123;&#25512;&#26029;&#24471;&#21040;&#20102;&#21512;&#32422;&#24211;&#30340;&#25903;&#25345;&#24182;&#19988;&#21487;&#20197;&#29992;&#26469;&#26500;&#24314;&#26032;&#21512;&#32422;&#65292;&#20294;&#26159;&#36825;&#20010;&#21512;&#32422;&#24211;&#20063;&#20026;&#20102;&#26356;&#26377;&#25928;&#30340;&#25512;&#26029;&#25903;&#25345;&#19968;&#20010;&#19981;&#21516;&#30340;API&#12290;&#20855;&#20307;&#26469;&#35828;&#65292;&#19968;&#20010;<font class="badlink"><span class="techoutside"><span class="techinside">&#21518;&#36127;&#25512;&#26029;&#65288;late neg projection&#65289;</span></span></font>&#25509;&#21463;&#19968;&#20010;&#19981;&#24102;&#21453;&#38754;&#24402;&#21646;&#30340;&#20449;&#24687;&#30340;&#24402;&#21646;&#23545;&#35937;&#65292;&#28982;&#21518;&#25353;&#29031;&#36825;&#20010;&#39034;&#24207;&#36820;&#22238;&#19968;&#20010;&#20989;&#25968;&#65292;&#23427;&#26082;&#25509;&#21463;&#21512;&#32422;&#32422;&#23450;&#30340;&#20540;&#20063;&#25509;&#21463;&#35813;&#34987;&#21160;&#26041;&#30340;&#21517;&#31216;&#12290;&#36825;&#20010;&#36820;&#22238;&#20989;&#25968;&#25509;&#30528;&#20381;&#27425;&#26681;&#25454;&#21512;&#32422;&#36820;&#22238;&#20540;&#12290;&#30475;&#36215;&#26469;&#20687;&#36825;&#26679;&#37325;&#20889;<span class="RktSym">int-&gt;int-proj</span>&#20197;&#20351;&#29992;&#36825;&#20010;API&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-&gt;int-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom-blame</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"the argument of"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:swap?</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng-blame</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="hspace">&nbsp;</span><span class="RktVal">"the range of"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-int</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="hspace">&nbsp;</span><span class="RktSym">to-blame</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">unless</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">to-blame</span><span class="hspace">&nbsp;</span><span class="RktPn">#:missing-party</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">v</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"an integer"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-int</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">dom-blame</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">ans</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-int</span><span class="hspace">&nbsp;</span><span class="RktSym">ans</span><span class="hspace">&nbsp;</span><span class="RktSym">rng-blame</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">ans</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">blame</span><span class="hspace">&nbsp;</span><span class="RktPn">#:missing-party</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"a procedure of one argument"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#36825;&#31181;&#31867;&#22411;&#30340;&#21512;&#32422;&#30340;&#20248;&#28857;&#26159;&#65292;<span class="RktVar">blame</span>&#21442;&#25968;&#33021;&#22815;&#22312;&#21512;&#21516;&#36793;&#30028;&#30340;&#26381;&#21153;&#22120;&#19968;&#36793;&#34987;&#25552;&#20379;&#65292;&#32780;&#19988;&#36825;&#20010;&#32467;&#26524;&#21487;&#20197;&#34987;&#29992;&#20110;&#27599;&#20010;&#19981;&#21516;&#30340;&#23458;&#25143;&#31471;&#12290;&#22312;&#36739;&#31616;&#21333;&#30340;&#24773;&#20917;&#19979;&#65292;&#19968;&#20010;&#26032;&#30340;&#24402;&#21646;&#23545;&#35937;&#24517;&#39035;&#20026;&#27599;&#20010;&#23458;&#25143;&#31471;&#34987;&#21019;&#24314;&#12290;</p><p>&#26368;&#21518;&#19968;&#20010;&#38382;&#39064;&#22312;&#36825;&#20010;&#21512;&#32422;&#33021;&#22815;&#19982;&#21097;&#20313;&#30340;&#21512;&#32422;&#31995;&#32479;&#19968;&#36215;&#20351;&#29992;&#20043;&#21069;&#20219;&#28982;&#23384;&#22312;&#12290;&#22312;&#19978;&#38754;&#30340;&#20989;&#25968;&#20013;&#65292;&#36825;&#20010;&#21512;&#32422;&#36890;&#36807;&#20026;<span class="RktSym">f</span>&#21019;&#24314;&#19968;&#20010;&#21253;&#35013;&#20989;&#25968;&#26469;&#23454;&#29616;&#65292;&#20294;&#26159;&#36825;&#20010;&#21253;&#35013;&#22120;&#20989;&#25968;&#19982;<span class="RktSym"><span class="badlink"><span class="RktValLink">equal?</span></span></span>&#19981;&#21327;&#20316;&#65292;&#23427;&#20063;&#19981;&#35753;&#36816;&#34892;&#26102;&#31995;&#32479;&#30693;&#36947;&#36825;&#37324;&#26377;&#19968;&#20010;&#32467;&#26524;&#20989;&#25968;&#19982;&#36755;&#20837;&#20989;&#25968;<span class="RktSym">f</span>&#20043;&#38388;&#30340;&#32852;&#31995;&#12290;</p><p>&#20026;&#20102;&#35299;&#20915;&#36825;&#20004;&#20010;&#38382;&#39064;&#65292;&#25105;&#20204;&#24212;&#35813;&#20351;&#29992;<font class="badlink"><span class="techoutside"><span class="techinside">&#30417;&#25252;&#65288;chaperones&#65289;</span></span></font>&#32780;&#19981;&#26159;&#20165;&#20165;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span>&#26469;&#21019;&#24314;&#21253;&#35013;&#22120;&#20989;&#25968;&#12290;&#36825;&#37324;&#26159;&#36825;&#20010;&#34987;&#37325;&#20889;&#20197;&#20351;&#29992;<font class="badlink"><span class="techoutside"><span class="techinside">&#30417;&#25252;</span></span></font>&#30340;<span class="RktSym">int-&gt;int-proj</span>&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">int-&gt;int-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom-blame</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"the argument of"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:swap?</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng-blame</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="hspace">&nbsp;</span><span class="RktVal">"the range of"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-int</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="hspace">&nbsp;</span><span class="RktSym">to-blame</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">unless</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">to-blame</span><span class="hspace">&nbsp;</span><span class="RktPn">#:missing-party</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">v</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"an integer"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">chaperone-procedure</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-int</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">dom-blame</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">values</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">ans</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-int</span><span class="hspace">&nbsp;</span><span class="RktSym">ans</span><span class="hspace">&nbsp;</span><span class="RktSym">rng-blame</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">ans</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">blame</span><span class="hspace">&nbsp;</span><span class="RktPn">#:missing-party</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"a procedure of one argument"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#22914;&#19978;&#25152;&#36848;&#30340;&#25512;&#26029;&#65292;&#20294;&#36866;&#21512;&#20110;&#20854;&#23427;&#65292;&#20320;&#21487;&#33021;&#21046;&#36896;&#30340;&#26032;&#31867;&#22411;&#30340;&#20540;&#65292;&#21487;&#20197;&#19982;&#21512;&#32422;&#24211;&#21407;&#35821;&#19968;&#36215;&#20351;&#29992;&#12290;&#20855;&#20307;&#26469;&#35828;&#65292;&#25105;&#20204;&#33021;&#22815;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">make-chaperone-contract</span></span></span>&#26469;&#26500;&#24314;&#23427;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">int-&gt;int-contract</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">make-contract</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:name</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">int-&gt;int</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:late-neg-projection</span><span class="hspace">&nbsp;</span><span class="RktSym">int-&gt;int-proj</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#24182;&#19988;&#25509;&#30528;&#23558;&#20854;&#19982;&#19968;&#20010;&#20540;&#30456;&#32467;&#21512;&#24182;&#24471;&#21040;&#19968;&#20123;&#21512;&#32422;&#26816;&#26597;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define/contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">int-&gt;int-contract</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"not an int"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p>&nbsp;</p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">f: contract violation;</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr">expected an integer</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">given: #f</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: the argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">int-&gt;int</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">contract from: (function f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(assuming the contract is correct)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: eval:5.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">f: broke its own contract;</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr">promised an integer</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">produced: "not an int"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: the range of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">int-&gt;int</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">contract from: (function f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">blaming: (function f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(assuming the contract is correct)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: eval:5.0</span></p></td></tr></table></td></tr></table></blockquote><h5>7.8.1<tt>&nbsp;</tt><a name="(part._.Contract-.Struct-.Properties)"></a>&#21512;&#32422;&#32467;&#26500;&#23646;&#24615;</h5><p>&#23545;&#20110;&#19968;&#27425;&#24615;&#21512;&#32422;&#26469;&#35828;<span class="RktSym"><span class="badlink"><span class="RktValLink">make-chaperone-contract</span></span></span>&#20989;&#25968;&#26159;&#21487;&#20197;&#30340;&#65292;&#20294;&#36890;&#24120;&#20320;&#24819;&#21046;&#23450;&#35768;&#22810;&#19981;&#21516;&#30340;&#21512;&#32422;&#65292;&#20165;&#22312;&#26576;&#20123;&#26041;&#38754;&#19981;&#21516;&#12290;&#20570;&#21040;&#36825;&#19968;&#28857;&#30340;&#26368;&#22909;&#26041;&#27861;&#26159;&#20351;&#29992;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">struct</span></span></span>&#65292;&#24102;&#26377;<span class="RktSym"><span class="badlink"><span class="RktValLink">prop:contract</span></span></span>&#12289;<span class="RktSym"><span class="badlink"><span class="RktValLink">prop:chaperone-contract</span></span></span>&#25110;<span class="RktSym"><span class="badlink"><span class="RktValLink">prop:flat-contract</span></span></span>&#12290;</p><p>&#20363;&#22914;&#65292;&#20551;&#35774;&#25105;&#20204;&#24819;&#21046;&#23450;&#25509;&#21463;&#19968;&#20010;&#20540;&#22495;&#21512;&#32422;&#21644;&#19968;&#20010;&#23450;&#20041;&#22495;&#21512;&#32422;&#30340;<span class="RktSym"><span class="badlink"><span class="RktValLink">-&gt;</span></span></span>&#21512;&#32422;&#30340;&#19968;&#20010;&#31616;&#21333;&#34920;&#12290;&#25105;&#20204;&#24212;&#35813;&#23450;&#20041;&#19968;&#20010;&#24102;&#26377;&#20004;&#20010;&#23383;&#27573;&#30340;&#32467;&#26500;&#24182;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">build-chaperone-contract-property</span></span></span>&#26469;&#26500;&#24314;&#25105;&#20204;&#38656;&#35201;&#30340;&#30417;&#25252;&#21512;&#32422;&#23646;&#24615;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">struct</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">simple-arrow</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">#:property</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">prop:chaperone-contract</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">build-chaperone-contract-property</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:name</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-name</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:late-neg-projection</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-late-neg-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#35201;&#20687;<span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span>&#21644;<span class="RktVal">#f</span>&#37027;&#26679;&#23545;&#20540;&#36827;&#34892;&#33258;&#21160;&#24378;&#21046;&#65292;&#25105;&#20204;&#38656;&#35201;&#35843;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-chaperone-contract</span></span></span>&#65288;&#27880;&#24847;&#36825;&#20010;&#25298;&#32477;&#27169;&#25311;&#21512;&#32422;&#24182;&#23545;&#25153;&#24179;&#21512;&#32422;&#19981;&#20104;&#22362;&#25345;&#65307;&#35201;&#21435;&#20570;&#37027;&#20123;&#20107;&#24773;&#20013;&#30340;&#20219;&#20309;&#19968;&#20214;&#65292;&#32780;&#19981;&#26159;&#35843;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-contract</span></span></span>&#25110;<span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-flat-contract</span></span></span>&#65289;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">dom</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#21435;&#23450;&#20041;<span class="RktVar">simple-arrow-name</span>&#26159;&#30452;&#25130;&#20102;&#24403;&#30340;&#65307;&#23427;&#38656;&#35201;&#36820;&#22238;&#19968;&#20010;&#34920;&#31034;&#21512;&#32422;&#30340;S&#34920;&#36798;&#24335;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-name</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">`</span><span class="RktVal">(</span><span class="RktVal"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktRdr">,</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-name</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-dom</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktRdr">,</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-name</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#24182;&#19988;&#25105;&#20204;&#33021;&#22815;&#20351;&#29992;&#25105;&#20204;&#21069;&#38754;&#23450;&#20041;&#30340;&#19968;&#20010;&#24191;&#20041;&#30340;&#25512;&#26029;&#26469;&#23450;&#20041;&#36825;&#20010;&#25512;&#26029;&#65292;&#36825;&#27425;&#20351;&#29992;<font class="badlink"><span class="techoutside"><span class="techinside">&#30417;&#25252;&#65288;chaperones&#65289;</span></span></font>&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-late-neg-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom-ctc</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">get/build-late-neg-projection</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-dom</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng-ctc</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">get/build-late-neg-projection</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">blame</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom+blame</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom-ctc</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"the argument of"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:swap?</span><span class="hspace">&nbsp;</span><span class="RktVal">#t</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng+blame</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rng-ctc</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">blame-add-context</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">blame</span><span class="hspace">&nbsp;</span><span class="RktVal">"the range of"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">chaperone-procedure</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">arg</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">values</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">result</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rng+blame</span><span class="hspace">&nbsp;</span><span class="RktSym">result</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom+blame</span><span class="hspace">&nbsp;</span><span class="RktSym">arg</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-blame-error</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">blame</span><span class="hspace">&nbsp;</span><span class="RktPn">#:missing-party</span><span class="hspace">&nbsp;</span><span class="RktSym">neg-party</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">expected</span><span class="hspace">&nbsp;</span><span class="RktVal">"a procedure of one argument"</span><span class="hspace">&nbsp;</span><span class="RktVal">given:</span><span class="hspace">&nbsp;</span><span class="RktVal">"~e"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define/contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">boolean?</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"not a boolean"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p>&nbsp;</p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">f: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">expected: integer?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">given: #f</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: the argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(-&gt; integer? boolean?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">contract from: (function f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(assuming the contract is correct)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: eval:12.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">f: broke its own contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">promised: boolean?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">produced: "not a boolean"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: the range of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(-&gt; integer? boolean?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">contract from: (function f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">blaming: (function f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(assuming the contract is correct)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: eval:12.0</span></p></td></tr></table></td></tr></table></blockquote><h5>7.8.2<tt>&nbsp;</tt><a name="(part._.With-all-the-.Bells-and-.Whistles)"></a>&#20351;&#25152;&#26377;&#35686;&#21578;&#21644;&#25253;&#35686;&#19968;&#33268;</h5><p>&#36825;&#37324;&#26377;&#19968;&#20123;&#23545;&#19968;&#20010;<span class="RktSym">simple-arrow-contract</span>&#27809;&#26377;&#28155;&#21152;&#30340;&#21512;&#32422;&#30340;&#21487;&#36873;&#37096;&#20998;&#12290;&#22312;&#36825;&#19968;&#33410;&#20013;&#65292;&#25105;&#20204;&#36890;&#36807;&#25152;&#26377;&#30340;&#20363;&#23376;&#26469;&#23637;&#31034;&#23427;&#20204;&#26159;&#22914;&#20309;&#23454;&#29616;&#30340;&#12290;</p><p>&#39318;&#20808;&#26159;&#19968;&#20010;&#19968;&#38454;&#26816;&#26597;&#12290;&#36825;&#26159;&#34987;<span class="RktSym"><span class="badlink"><span class="RktValLink">or/c</span></span></span>&#20351;&#29992;&#26469;&#30830;&#23450;&#37027;&#19968;&#20010;&#39640;&#38454;&#21442;&#25968;&#21512;&#32422;&#22312;&#23427;&#30475;&#21040;&#19968;&#20010;&#20540;&#26102;&#21435;&#20351;&#29992;&#12290;&#19979;&#38754;&#26159;&#25105;&#20204;&#31616;&#21333;&#31661;&#22836;&#21512;&#32422;&#30340;&#20989;&#25968;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-first-order</span><span class="hspace">&nbsp;</span><span class="RktSym">ctc</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure-arity-includes?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#22914;&#26524;&#36825;&#20010;&#20540;&#30830;&#23454;&#19981;&#28385;&#36275;&#21512;&#32422;&#65292;&#23427;&#25509;&#21463;&#19968;&#20010;&#20540;&#24182;&#36820;&#22238;<span class="RktVal">#f</span>&#65292;&#24182;&#19988;&#22914;&#36820;&#22238;<span class="RktVal">#t</span>&#65292;&#21482;&#35201;&#25105;&#20204;&#33021;&#22815;&#36776;&#21035;&#65292;&#36825;&#20010;&#20540;&#28385;&#36275;&#21512;&#32422;&#65292;&#21482;&#26159;&#26816;&#26597;&#20540;&#30340;&#19968;&#38454;&#23646;&#24615;&#12290;</p><p>&#20854;&#27425;&#26159;&#38543;&#26426;&#29983;&#25104;&#12290;&#21512;&#32422;&#24211;&#20013;&#30340;&#38543;&#26426;&#29983;&#25104;&#20998;&#20026;&#20004;&#37096;&#20998;&#65306;&#38543;&#26426;&#29983;&#25104;&#28385;&#36275;&#21512;&#32422;&#30340;&#20540;&#30340;&#33021;&#21147;&#20197;&#21450;&#36816;&#29992;&#21305;&#37197;&#36825;&#20010;&#32473;&#23450;&#21512;&#32422;&#30340;&#20540;&#30340;&#33021;&#21147;&#65292;&#24076;&#26395;&#21457;&#29616;&#20854;&#20013;&#30340;&#38169;&#35823;&#65288;&#24182;&#20063;&#35797;&#22270;&#20351;&#23427;&#20204;&#20135;&#29983;&#20196;&#20154;&#24863;&#20852;&#36259;&#30340;&#20540;&#20197;&#22312;&#29983;&#25104;&#26399;&#38388;&#34987;&#29992;&#20110;&#20854;&#23427;&#22320;&#26041;&#65289;&#12290;</p><p>&#20026;&#20102;&#36816;&#29992;&#21512;&#32422;&#65292;&#25105;&#20204;&#38656;&#35201;&#23454;&#29616;&#19968;&#20010;&#34987;&#32473;&#23450;&#19968;&#20010;<span class="RktSym">arrow-contract</span>&#32467;&#26500;&#30340;&#20989;&#25968;&#21644;&#19968;&#20123;&#36741;&#21161;&#20989;&#25968;&#12290;&#23427;&#24212;&#35813;&#36820;&#22238;&#20004;&#20010;&#20540;&#65306;&#19968;&#20010;&#25509;&#21463;&#21512;&#32422;&#20540;&#24182;&#36816;&#29992;&#23427;&#20204;&#30340;&#20989;&#25968;&#65307;&#22806;&#21152;&#36816;&#29992;&#36827;&#31243;&#24635;&#20250;&#20135;&#29983;&#30340;&#19968;&#20010;&#20540;&#21015;&#34920;&#12290;&#22312;&#25105;&#20204;&#31616;&#21333;&#21512;&#32422;&#30340;&#24773;&#20917;&#65292;&#25105;&#20204;&#30693;&#36947;&#25105;&#20204;&#24635;&#33021;&#20135;&#29983;&#20540;&#22495;&#30340;&#20540;&#65292;&#21482;&#35201;&#25105;&#20204;&#33021;&#22815;&#29983;&#25104;&#23450;&#20041;&#22495;&#30340;&#20540;&#65288;&#22240;&#20026;&#25105;&#20204;&#33021;&#22815;&#20165;&#35843;&#29992;&#36825;&#20010;&#20989;&#25968;&#65289;&#12290;&#22240;&#27492;&#65292;&#36825;&#37324;&#26377;&#19968;&#20010;&#21305;&#37197;<span class="RktSym"><span class="badlink"><span class="RktValLink">build-chaperone-contract-property</span></span></span>&#30340;&#21512;&#32422;&#30340;<span class="RktVar">exercise</span>&#21442;&#25968;&#30340;&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract-exercise</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">env</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate-get-current-environment</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">fuel</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">dom-generate</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate/choose</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-dom</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">fuel</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cond</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">dom-generate</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">values</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate-stash</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">env</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom-generate</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><span class="badlink"><span class="RktValLink">else</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">values</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">void</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#22914;&#26524;&#23450;&#20041;&#22495;&#21512;&#32422;&#21487;&#20197;&#34987;&#29983;&#25104;&#65292;&#37027;&#20040;&#25105;&#20204;&#30693;&#36947;&#25105;&#20204;&#33021;&#22815;&#36890;&#36807;&#36816;&#29992;&#20570;&#19968;&#20123;&#22909;&#30340;&#20107;&#24773;&#12290;&#22312;&#36825;&#31181;&#24773;&#20917;&#19979;&#65292;&#25105;&#20204;&#36820;&#22238;&#19968;&#20010;&#36807;&#31243;&#65292;&#23427;&#29992;&#25105;&#20204;&#20174;&#23450;&#20041;&#22495;&#29983;&#25104;&#30340;&#19996;&#35199;&#35843;&#29992;<span class="RktVar">f</span>&#65288;&#21305;&#37197;&#36825;&#20010;&#21512;&#32422;&#20989;&#25968;&#65289;&#65292;&#24182;&#19988;&#25105;&#20204;&#20063;&#22312;&#29615;&#22659;&#20013;&#38544;&#34255;&#36825;&#20010;&#32467;&#26524;&#20540;&#12290;&#25105;&#20204;&#20063;&#36820;&#22238;<span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="stt"> </span><span class="RktSym">arr</span><span class="RktPn">)</span>&#26469;&#34920;&#26126;&#36816;&#29992;&#24635;&#20250;&#20135;&#29983;&#37027;&#20010;&#21512;&#32422;&#30340;&#26576;&#20123;&#19996;&#35199;&#12290;</p><p>&#22914;&#26524;&#25105;&#20204;&#19981;&#33021;&#20570;&#21040;&#65292;&#37027;&#20040;&#25105;&#20204;&#21482;&#31616;&#21333;&#22320;&#36820;&#22238;&#19968;&#20010;&#20989;&#25968;&#65292;&#23427;&#19981;&#36816;&#29992;(<span class="RktSym"><span class="badlink"><span class="RktValLink">void</span></span></span>)&#21644;&#31354;&#21015;&#34920;&#65288;&#34920;&#31034;&#25105;&#20204;&#19981;&#20250;&#29983;&#25104;&#20219;&#20309;&#20540;&#65289;&#12290;</p><p>&#28982;&#21518;&#65292;&#20026;&#20102;&#29983;&#25104;&#19982;&#36825;&#20010;&#21512;&#32422;&#30456;&#21305;&#37197;&#30340;&#20540;&#65292;&#25105;&#20204;&#23450;&#20041;&#19968;&#20010;&#22312;&#32473;&#23450;&#21512;&#32422;&#21644;&#26576;&#20123;&#36741;&#21161;&#20989;&#25968;&#26102;&#25104;&#20026;&#19968;&#20010;&#38543;&#26426;&#20989;&#25968;&#30340;&#20989;&#25968;&#12290;&#20026;&#20102;&#24110;&#21161;&#23427;&#25104;&#20026;&#19968;&#20010;&#26356;&#26377;&#25928;&#30340;&#27979;&#35797;&#20989;&#25968;&#65292;&#25105;&#20204;&#21487;&#20197;&#36816;&#29992;&#23427;&#25509;&#21463;&#30340;&#20219;&#20309;&#21442;&#25968;&#65292;&#21516;&#26102;&#20063;&#23558;&#23427;&#20204;&#20445;&#23384;&#21040;&#29983;&#25104;&#29615;&#22659;&#20013;&#65292;&#20294;&#21069;&#25552;&#26159;&#25105;&#20204;&#21487;&#20197;&#29983;&#25104;&#20540;&#22495;&#21512;&#32422;&#30340;&#20540;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract-generate</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">fuel</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">env</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate-get-current-environment</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">rng-generate</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate/choose</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">fuel</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">cond</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym">rng-generate</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">arg</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate-stash</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">env</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-dom</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">arg</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rng-generate</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><span class="badlink"><span class="RktValLink">else</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#24403;&#36825;&#20010;&#38543;&#26426;&#29983;&#25104;&#23558;&#26576;&#20010;&#19996;&#35199;&#25289;&#20986;&#29615;&#22659;&#26102;&#65292;&#23427;&#38656;&#35201;&#33021;&#22815;&#21028;&#26029;&#19968;&#20010;&#34987;&#20256;&#36882;&#32473;<span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate-stash</span></span></span>&#30340;&#20540;&#26159;&#21542;&#26159;&#19968;&#20010;&#35797;&#22270;&#29983;&#25104;&#30340;&#21512;&#32422;&#30340;&#20505;&#36873;&#23545;&#35937;&#12290;&#24403;&#28982;&#65292;&#21512;&#32422;&#20256;&#36882;&#32473;<span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate-stash</span></span></span>&#30340;&#26159;&#19968;&#20010;&#31934;&#30830;&#30340;&#21305;&#37197;&#65292;&#37027;&#20040;&#23427;&#23601;&#33021;&#22815;&#20351;&#29992;&#23427;&#12290;&#20294;&#26159;&#65292;&#22914;&#26524;&#36825;&#20010;&#21512;&#32422;&#26356;&#24378;&#65288;&#24847;&#24605;&#26159;&#23427;&#25509;&#21463;&#26356;&#23569;&#30340;&#20540;&#65289;&#65292;&#23427;&#20063;&#33021;&#22815;&#20351;&#29992;&#36825;&#20010;&#20215;&#20540;&#12290;</p><p>&#20026;&#20102;&#25552;&#20379;&#36825;&#20010;&#21151;&#33021;&#65292;&#25105;&#20204;&#23454;&#29616;&#36825;&#20010;&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-first-stronger?</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">this</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">that</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">and</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow?</span><span class="hspace">&nbsp;</span><span class="RktSym">that</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-stronger?</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-dom</span><span class="hspace">&nbsp;</span><span class="RktSym">that</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-dom</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">this</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-stronger?</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">this</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-rng</span><span class="hspace">&nbsp;</span><span class="RktSym">that</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#36825;&#20010;&#20989;&#25968;&#25509;&#21463;<span class="RktVar">this</span>&#21644;<span class="RktVar">that</span>&#65292;&#20004;&#20010;&#21512;&#32422;&#12290;&#23427;&#20445;&#35777;<span class="RktVar">this</span>&#23558;&#26159;&#25105;&#20204;&#30340;&#31616;&#21333;&#31661;&#22836;&#21512;&#32422;&#20043;&#19968;&#65292;&#22240;&#20026;&#25105;&#20204;&#27491;&#22312;&#29992;&#31616;&#21333;&#31661;&#22836;&#21512;&#32422;&#23454;&#29616;&#20379;&#24212;&#36825;&#20010;&#20989;&#25968;&#12290;&#20294;&#36825;&#20010;<span class="RktVar">that</span>&#21442;&#25968;&#20063;&#35768;&#26159;&#20219;&#20309;&#21512;&#32422;&#12290;&#22914;&#26524;&#21516;&#26679;&#27604;&#36739;&#23450;&#20041;&#22495;&#21644;&#20540;&#22495;&#65292;&#36825;&#20010;&#20989;&#25968;&#26816;&#26597;&#20197;&#24324;&#26126;&#30333;&#26159;&#21542;<span class="RktVar">that</span>&#20063;&#26159;&#19968;&#20010;&#31616;&#21333;&#31661;&#22836;&#21512;&#32422;&#12290;&#24403;&#28982;&#65292;&#37027;&#37324;&#36824;&#26377;&#20854;&#23427;&#30340;&#21512;&#32422;&#65292;&#25105;&#20204;&#20063;&#21487;&#20197;&#26816;&#26597;&#65288;&#20363;&#22914;&#65292;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">-&gt;</span></span></span>&#25110;<span class="RktSym"><span class="badlink"><span class="RktValLink">-&gt;*</span></span></span>&#30340;&#21512;&#32422;&#26500;&#24314;&#65289;&#65292;&#20294;&#25105;&#20204;&#24182;&#19981;&#38656;&#35201;&#12290;&#22914;&#26524;&#36825;&#20010;&#26356;&#24378;&#30340;&#20989;&#25968;&#19981;&#30693;&#36947;&#31572;&#26696;&#20294;&#22914;&#26524;&#23427;&#36820;&#22238;<span class="RktVal">#t</span>&#65292;&#23427;&#34987;&#20801;&#35768;&#36820;&#22238;<span class="RktVal">#f</span>&#65292;&#37027;&#20040;&#36825;&#20010;&#21512;&#32422;&#24517;&#39035;&#30495;&#27491;&#21464;&#24471;&#26356;&#24378;&#12290;</p><p>&#26082;&#28982;&#25105;&#20204;&#26377;&#23454;&#29616;&#20102;&#30340;&#25152;&#26377;&#37096;&#20998;&#65292;&#25105;&#20204;&#38656;&#35201;&#20256;&#36882;&#23427;&#20204;&#32473;<span class="RktSym"><span class="badlink"><span class="RktValLink">build-chaperone-contract-property</span></span></span>&#65292;&#36825;&#26679;&#21512;&#32422;&#31995;&#32479;&#23601;&#24320;&#22987;&#20351;&#29992;&#23427;&#20204;&#20102;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">struct</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">simple-arrow</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">#:property</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">prop:custom-write</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-custom-write-property-proc</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">#:property</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">prop:chaperone-contract</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">build-chaperone-contract-property</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:name</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-name</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:late-neg-projection</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">&#955;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-late-neg-proj</span><span class="hspace">&nbsp;</span><span class="RktSym">arr</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:first-order</span><span class="hspace">&nbsp;</span><span class="RktSym">simple-arrow-first-order</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:stronger</span><span class="hspace">&nbsp;</span><span class="RktSym">simple-arrow-first-stronger?</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:generate</span><span class="hspace">&nbsp;</span><span class="RktSym">simple-arrow-contract-generate</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:exercise</span><span class="hspace">&nbsp;</span><span class="RktSym">simple-arrow-contract-exercise</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">dom</span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">dom</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">coerce-contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym">rng</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote><p>&#25105;&#20204;&#36824;&#28155;&#21152;&#20102;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">prop:custom-write</span></span></span>&#23646;&#24615;&#20197;&#20415;&#36825;&#20010;&#21512;&#32422;&#27491;&#30830;&#25171;&#21360;&#65292;&#20363;&#22914;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(-&gt; integer? integer?)</span></p></td></tr></table></blockquote><p><div class="SIntrapara">&#65288;&#22240;&#20026;&#21512;&#32422;&#24211;&#19981;&#33021;&#20381;&#36182;&#20110;</div><div class="SIntrapara"><blockquote class="SCodeFlow"><p><font class="badlink"><span class="RktModLink"><span class="RktMod">#lang</span></span></font><span class="hspace">&nbsp;</span><font class="badlink"><span class="RktModLink"><span class="RktSym">racket/generic</span></span></font></p></blockquote></div><div class="SIntrapara">&#20294;&#20173;&#28982;&#24076;&#26395;&#25552;&#20379;&#19968;&#20123;&#24110;&#21161;&#20197;&#20415;&#20110;&#20351;&#29992;&#27491;&#30830;&#30340;&#25171;&#21360;&#26426;&#65292;&#25105;&#20204;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">prop:custom-write</span></span></span>&#12290;&#65289;</div></p><p>&#26082;&#28982;&#37027;&#20123;&#24050;&#32463;&#23436;&#25104;&#65292;&#25105;&#20204;&#23601;&#33021;&#22815;&#20351;&#29992;&#26032;&#21151;&#33021;&#12290;&#36825;&#37324;&#26377;&#19968;&#20010;&#38543;&#26426;&#20989;&#25968;&#65292;&#23427;&#30001;&#21512;&#32422;&#24211;&#29983;&#25104;&#65292;&#20351;&#29992;&#25105;&#20204;&#30340;<span class="RktSym">simple-arrow-contract-generate</span>&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">a-random-function</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-random-generate</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p>&nbsp;</p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">a-random-function</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">a-random-function</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr></table></td></tr></table></blockquote><p>&#36825;&#37324;&#26159;&#26159;&#21512;&#32422;&#31995;&#32479;&#24590;&#20040;&#33021;&#22312;&#20351;&#29992;&#31616;&#21333;&#31661;&#22836;&#21512;&#32422;&#30340;&#20989;&#25968;&#20013;&#31435;&#21051;&#33258;&#21160;&#21457;&#29616;&#32570;&#38519;&#65288;bug&#65289;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define/contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">misbehaved-f</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">-&gt;</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">integer?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">boolean?</span></span></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">any</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">"not an integer"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p>&nbsp;</p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">contract-exercise</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">misbehaved-f</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">misbehaved-f: broke its own contract</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">promised: integer?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">produced: "not an integer"</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: the argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">the 1st argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(-&gt; (-&gt; integer? boolean?) any)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">contract from: (function misbehaved-f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">blaming: (function misbehaved-f)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(assuming the contract is correct)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: eval:25.0</span></p></td></tr></table></td></tr></table></blockquote><p>&#24182;&#19988;&#22914;&#26524;&#25105;&#20204;&#27809;&#26377;&#23454;&#29616;<span class="RktSym">simple-arrow-first-order</span>&#65292;&#37027;&#20040;<span class="RktSym"><span class="badlink"><span class="RktValLink">or/c</span></span></span>&#23601;&#19981;&#33021;&#22815;&#36776;&#21035;&#36825;&#20010;&#31243;&#24207;&#20013;&#20351;&#29992;&#21738;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">or/c</span></span></span>&#20998;&#25903;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define/contract</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">maybe-accepts-a-function</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">or/c</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">simple-arrow-contract</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">real?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">real?</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">-&gt;</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">real?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">real?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">real?</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">real?</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">procedure?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">procedure-arity-includes</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">1132</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">11</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p>&nbsp;</p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">maybe-accepts-a-function</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">sqrt</span></span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">maybe-accepts-a-function: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">expected: real?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">given: #&lt;procedure:sqrt&gt;</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: the argument of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">a part of the or/c of</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(or/c</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(-&gt; real? real?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(-&gt; real? real? real?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">real?)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">contract from: </span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(function maybe-accepts-a-function)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">blaming: top-level</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">(assuming the contract is correct)</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: eval:27.0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">maybe-accepts-a-function</span><span class="hspace">&nbsp;</span><span class="RktVal">123</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">123</span></p></td></tr></table></td></tr></table></blockquote><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="contracts-examples.html" title="backward to &quot;7.7 附加实例&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="contracts.html" title="up to &quot;7 合约&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="contracts-gotchas.html" title="forward to &quot;7.9 问题&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>